tree.using('tree.ui');

var proxy = new tree.io.rpc.JSON_Proxy('/rpc');

var table = new Table();
table.set_style('margin', 'auto');
table.set_style('width', 'auto');

table.add(new Label('All Sites'), 0, 0, null, '20%');

var homepages = proxy.call_method('get_homepages', []);

var offset = 2;
for(var page in homepages)
{
    var url = homepages[page];
    var l1 = new Label(page)
    var l2 = new Label(url);
    table.add(l1, 0, offset);
    table.add(l2, 1, offset);
    offset += 1;
}

tree.ui.Window.show(table);
